package cn.baisee.com.demo.controller;

import cn.baisee.com.demo.model.GenTable;
import cn.baisee.com.demo.service.PerasonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
public class TableController {
    @Autowired
    PerasonService perasonService;
    @RequestMapping("/")
    public ModelAndView index(){

        ModelAndView mav = new ModelAndView("index");
        List<GenTable> list = perasonService.getAll();
        mav.addObject("list",list);
        return mav;
    }

}
